import request from '@/utils/request'
import { commonBaseUrl } from '@/utils'

const moduleName = commonBaseUrl('B')
export function getPrjDetailApi(params) {
    return request({
        url: moduleName + 'api/adjustment/queryPrjInfo',
        params
    })
}
// 查询获取表格接口
export function getSearchList(data) {
    return request({
        url: moduleName + 'tAuditDeclineList/queryList',
        method: 'post',
        data,
        showLoading: true
    })
}
// 获取查询的分页数据
export function getSearchCount(data) {
    return request({
        url: moduleName + 'tAuditDeclineList/queryListCount',
        method: 'post',
        data,
        showLoading: true
    })
}
// 获取辅助信息查询列表
export function getAssistList(data) {
    return request({
        url: moduleName + `tAuditDecline/queryByPrjCode?prjCode=${data.prjCode}`,
        method: 'get',
        showLoading: true
    })
}
// 审减退库基本信息
export function getAudit(params) {
    return request({
        url: moduleName + 'tAuditDecline/queryById',
        method: 'get',
        params,
        // showLoading: true
    })
}

// 获取表格数据
export function getTableList(data) {
    return request({
        url: moduleName + `tAuditDecline/queryAuditDeclineItemList?reduceId=${data.reduceId}`,
        method: 'post',
        // showLoading: true
    })
}
// 保存数据
export function saveData(data) {
    return request({
        url: moduleName + 'tAuditDecline/saveAuditAndCancellStocksData',
        method: 'post',
        data,
        showLoading: true
    })
}
// 查询 表格精度
export function getTableCount(params) {
    return request({
        url: moduleName + `tAuditDecline/queryMaterialInfoByCodes`,
        method: 'get',
        params,
        // showLoading: true
    })
}

// 物资退库接口
export function getMaterialReturn(data) {
    return request({
        url: moduleName + `tAuditDecline/pushProductBindingToFinance`,
        method: 'post',
        showLoading: true,
        data
    })
}

// 下一步 回退 转派确认选人接口
export function getConfirmPersonList(data) {
    return request({
        url: moduleName + 'tAuditDecline/auditReduceNextFlow',
        method: 'post',
        data,
        showLoading: true
    })
}

// 退库获取id
export function getDeclineId(data) {
    return request({
        url: moduleName + 'tAuditDecline/creatWorkFlow',
        method: 'post',
        data,
        showLoading: true
    })
}

// 下一步特殊校验
export function getSpecialCheck(data) {
    return request({
        url: moduleName + `tAuditDecline/pushAuditReduce`,
        method: 'post',
        data,
        showLoading: true
    })
}

// 获取路由参数
export function getRouteParams(data) {
    return request({
        url: moduleName + `tAuditDecline/getRoute?reduceId=${data.reduceId}&currentNodeId=${data.currentNodeId}`,
        method: 'post',
        showLoading: true
    })
}
export function getConfigAcquisitionTreeList(data) {
    return request({
        url: moduleName + 'api/limit_correct/getOrgTree',
        method: 'post',
        data,
        showLoading: true
    })
}

// 提交校验提示i信息
export function getSubmitCheck(data) {
    return request({
        url: moduleName + `tAuditDecline/checkStocksData?reduceId=${data.reduceId}`,
        method: 'post',
        // showLoading: true
    })
}